﻿using Masuit.Tools.Systems;
using SixLabors.ImageSharp;
using SixLabors.ImageSharp.PixelFormats;

namespace LogionDemo.Extensions
{
	public static class ValidateCodeExtension
    {
        public static Stream ToStream(this PooledMemoryStream stream)
        {
            Image<Rgba32> image = SixLabors.ImageSharp.Image.Load<Rgba32>(stream);
            MemoryStream memoryStream = new MemoryStream();
            image.SaveAsPng(memoryStream);
            return memoryStream;
        }
    }
}
